package com.hmis.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 处方信息表
 *
 * @TableName prescription
 */
@TableName(value = "prescription")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Prescription implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 处方编号
     */
    @TableId(value = "prescription_id", type = IdType.AUTO)
    private Long prescriptionId;
    /**
     * 病人编号
     */
    @TableField(value = "patient_id")
    private Long patientId;
    /**
     * 病人姓名
     */
    @TableField(value = "patient_name")
    private String patientName;
    /**
     * 病房编号
     */
    @TableField(value = "ward_no")
    private Long wardNo;
    /**
     * 床位编号
     */
    @TableField(value = "bed_no")
    private Long bedNo;
    /**
     * 第几床
     */
    @TableField(value = "the_bed_no")
    private Long theBedNo;
    /**
     * 主治医生id
     */
    @TableField(value = "doctor_id")
    private Long doctorId;
    /**
     * 主治医生
     */
    @TableField(value = "doctor_name")
    private String doctorName;
    /**
     * 所属科室id
     */
    @TableField(value = "dept_id")
    private Long deptId;
    /**
     * 所属科室
     */
    @TableField(value = "dept_name")
    private String deptName;
    /**
     * 总价
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;
    /**
     * 处方状态 0:未缴费 1:已缴费
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 修改时间
     */
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;
    /**
     * 是否删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Prescription other = (Prescription) that;
        return (this.getPrescriptionId() == null ? other.getPrescriptionId() == null : this.getPrescriptionId().equals(other.getPrescriptionId()))
                && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
                && (this.getPatientName() == null ? other.getPatientName() == null : this.getPatientName().equals(other.getPatientName()))
                && (this.getWardNo() == null ? other.getWardNo() == null : this.getWardNo().equals(other.getWardNo()))
                && (this.getBedNo() == null ? other.getBedNo() == null : this.getBedNo().equals(other.getBedNo()))
                && (this.getTheBedNo() == null ? other.getTheBedNo() == null : this.getTheBedNo().equals(other.getTheBedNo()))
                && (this.getDoctorId() == null ? other.getDoctorId() == null : this.getDoctorId().equals(other.getDoctorId()))
                && (this.getDoctorName() == null ? other.getDoctorName() == null : this.getDoctorName().equals(other.getDoctorName()))
                && (this.getDeptId() == null ? other.getDeptId() == null : this.getDeptId().equals(other.getDeptId()))
                && (this.getDeptName() == null ? other.getDeptName() == null : this.getDeptName().equals(other.getDeptName()))
                && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getModifyTime() == null ? other.getModifyTime() == null : this.getModifyTime().equals(other.getModifyTime()))
                && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrescriptionId() == null) ? 0 : getPrescriptionId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPatientName() == null) ? 0 : getPatientName().hashCode());
        result = prime * result + ((getWardNo() == null) ? 0 : getWardNo().hashCode());
        result = prime * result + ((getBedNo() == null) ? 0 : getBedNo().hashCode());
        result = prime * result + ((getTheBedNo() == null) ? 0 : getTheBedNo().hashCode());
        result = prime * result + ((getDoctorId() == null) ? 0 : getDoctorId().hashCode());
        result = prime * result + ((getDoctorName() == null) ? 0 : getDoctorName().hashCode());
        result = prime * result + ((getDeptId() == null) ? 0 : getDeptId().hashCode());
        result = prime * result + ((getDeptName() == null) ? 0 : getDeptName().hashCode());
        result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prescriptionId=").append(prescriptionId);
        sb.append(", patientId=").append(patientId);
        sb.append(", patientName=").append(patientName);
        sb.append(", wardNo=").append(wardNo);
        sb.append(", bedNo=").append(bedNo);
        sb.append(", theBedNo=").append(theBedNo);
        sb.append(", doctorId=").append(doctorId);
        sb.append(", doctorName=").append(doctorName);
        sb.append(", deptId=").append(deptId);
        sb.append(", deptName=").append(deptName);
        sb.append(", totalPrice=").append(totalPrice);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", modifyTime=").append(modifyTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}